﻿using System.Web.Mvc;
using Turquoise.Web.Common.Entities;
using Turquoise.Web.Common.Infrastructure;

namespace Turquoise.Web.Management.Controllers.Pages.Redirection
{
    public class RedirectionController : TurquoiseController
    {
        #region Methods
        public ViewResult Redirect()
        {
            var redirectionModel = (RedirectionModel)TempData["RedirectionModel"];
            return View(redirectionModel);
        }

        public ActionResult RedirectAction(string url, string message, int timeout, string cssClass)
        {
            TempData["RedirectionModel"] = new RedirectionModel
            {
                Url = url,
                Message = message,
                Timeout = timeout,
                CssClass = cssClass
            };

            return RedirectToAction("Redirect", "Redirection");
        }
        #endregion
    }
}